package bo.zhao.action.abstract_factory;

import bo.zhao.action.abstract_factory.factory.ComputerFactory;
import bo.zhao.action.abstract_factory.factory.ESportsComputerFactory;
import bo.zhao.action.abstract_factory.factory.OfficeComputerFactory;
import bo.zhao.action.abstract_factory.product.keyboard.Keyboard;
import bo.zhao.action.abstract_factory.product.mouse.Mouse;

public class AbstractFactroyTest {

	public static void main(String[] args) {
	
		//办公电脑工厂类
		ComputerFactory factory = new OfficeComputerFactory();
		
		//生产出来的鼠标是办公鼠标
		Mouse mouse=factory.createMouse();
		mouse.click();
		mouse.scroll();
		
		//生产出来的键盘是办公键盘
		Keyboard keyboard = factory.createKeyboard();
		keyboard.keydown();
		keyboard.keyup();
		
		
		//电竞电脑工厂类
		factory = new ESportsComputerFactory();
		
		//生产出来的鼠标是电竞鼠标
		mouse=factory.createMouse();
		mouse.click();
		mouse.scroll();
		
		//生产出来的键盘是机械键盘
		keyboard = factory.createKeyboard();
		keyboard.keydown();
		keyboard.keyup();
		
		
		
	}
	
}
